/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('iqs', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AgentBaseQuery {
  query?: string(name='query'),
}

model CommonAgentQuery {
  limit?: int32(name='limit'),
  query?: string(name='query'),
  querySceneEnumCode?: string(name='querySceneEnumCode'),
  searchModel?: string(name='searchModel'),
}

model QueryResult {
  data?: [ 
    {
      address?: string(name='address'),
      cityCode?: string(name='cityCode'),
      cityName?: string(name='cityName'),
      distanceMeter?: string(name='distanceMeter'),
      districtCode?: string(name='districtCode'),
      districtName?: string(name='districtName'),
      id?: string(name='id'),
      images?: [ 
        {
          title?: string(name='title'),
          url?: string(name='url'),
        }
      ](name='images'),
      latitude?: string(name='latitude'),
      longitude?: string(name='longitude'),
      metadata?: {
        averageSpend?: string(name='averageSpend'),
        businessArea?: string(name='businessArea'),
        dailyOpeningHours?: string(name='dailyOpeningHours'),
        mainTag?: string(name='mainTag'),
        phone?: string(name='phone'),
        score?: string(name='score'),
        weeklyOpeningDays?: string(name='weeklyOpeningDays'),
      }(name='metadata'),
      name?: string(name='name'),
      provinceCode?: string(name='provinceCode'),
      provinceName?: string(name='provinceName'),
      typeCode?: string(name='typeCode'),
      types?: string(name='types'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
}

model BicyclingDirectionNovaRequest {
  destinationLatitude?: string(name='destinationLatitude', example='39.995197'),
  destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
  originLatitude?: string(name='originLatitude', example='39.995197'),
  originLongitude?: string(name='originLongitude', example='117.466485'),
  showPolyline?: boolean(name='showPolyline'),
}

model BicyclingDirectionNovaResponseBody = {
  data?: {
    count?: string(name='count'),
    destinationLatitude?: string(name='destinationLatitude', example='39.995197'),
    destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
    originLatitude?: string(name='originLatitude', example='39.995197'),
    originLongitude?: string(name='originLongitude', example='116.466485'),
    paths?: [ 
      {
        cost?: {
          durationSecond?: string(name='durationSecond', example='39233'),
          taxiFee?: string(name='taxiFee', example='20'),
          tollDistanceMeter?: string(name='tollDistanceMeter'),
          tollRoads?: string(name='tollRoads'),
          tolls?: string(name='tolls'),
          trafficLights?: string(name='trafficLights'),
          transitFee?: string(name='transitFee', example='4'),
        }(name='cost'),
        distanceMeter?: string(name='distanceMeter', example='96375'),
        durationSecond?: string(name='durationSecond', example='300'),
        restriction?: string(name='restriction'),
        steps?: [ 
          {
            cost?: {
              durationSecond?: string(name='durationSecond', example='2000'),
              taxiFee?: string(name='taxiFee', example='20'),
              tollDistanceMeter?: string(name='tollDistanceMeter'),
              tollRoads?: string(name='tollRoads'),
              tolls?: string(name='tolls'),
              trafficLights?: string(name='trafficLights'),
              transitFee?: string(name='transitFee'),
            }(name='cost'),
            instruction?: string(name='instruction'),
            orientation?: string(name='orientation'),
            polyline?: string(name='polyline'),
            roadName?: string(name='roadName'),
            stepDistanceMeter?: string(name='stepDistanceMeter', example='3000'),
          }
        ](name='steps'),
      }
    ](name='paths'),
    taxiCost?: string(name='taxiCost', example='23'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model BicyclingDirectionNovaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BicyclingDirectionNovaResponseBody(name='body'),
}

/**
 * @summary 根据起终点坐标检索符合条件的骑行路线规划方案
 *
 * @param request BicyclingDirectionNovaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BicyclingDirectionNovaResponse
 */
async function bicyclingDirectionNovaWithOptions(request: BicyclingDirectionNovaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): BicyclingDirectionNovaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.destinationLatitude)) {
    query['destinationLatitude'] = request.destinationLatitude;
  }
  if (!Util.isUnset(request.destinationLongitude)) {
    query['destinationLongitude'] = request.destinationLongitude;
  }
  if (!Util.isUnset(request.originLatitude)) {
    query['originLatitude'] = request.originLatitude;
  }
  if (!Util.isUnset(request.originLongitude)) {
    query['originLongitude'] = request.originLongitude;
  }
  if (!Util.isUnset(request.showPolyline)) {
    query['showPolyline'] = request.showPolyline;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BicyclingDirectionNova',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/direction/bicycling`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据起终点坐标检索符合条件的骑行路线规划方案
 *
 * @param request BicyclingDirectionNovaRequest
 * @return BicyclingDirectionNovaResponse
 */
async function bicyclingDirectionNova(request: BicyclingDirectionNovaRequest): BicyclingDirectionNovaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return bicyclingDirectionNovaWithOptions(request, headers, runtime);
}

model CommonQueryBySceneRequest {
  body?: CommonAgentQuery(name='body'),
}

model CommonQueryBySceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryResult  
}

/**
 * @summary 自然语言通用查询
 *
 * @param request CommonQueryBySceneRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CommonQueryBySceneResponse
 */
async function commonQueryBySceneWithOptions(request: CommonQueryBySceneRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CommonQueryBySceneResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'CommonQueryByScene',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v2/nl/common`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 自然语言通用查询
 *
 * @param request CommonQueryBySceneRequest
 * @return CommonQueryBySceneResponse
 */
async function commonQueryByScene(request: CommonQueryBySceneRequest): CommonQueryBySceneResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return commonQueryBySceneWithOptions(request, headers, runtime);
}

model DrivingDirectionRequest {
  destinationLatitude?: string(name='destinationLatitude', example='39.896463'),
  destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
  originLatitude?: string(name='originLatitude', example='39.995197'),
  originLongitude?: string(name='originLongitude', example='116.466485'),
}

model DrivingDirectionResponseBody = {
  data?: [ 
    {
      cost?: {
        durationSecond?: string(name='durationSecond', example='1231'),
        taxiFee?: string(name='taxiFee', example='6'),
        tollDistanceMeter?: string(name='tollDistanceMeter'),
        tollRoads?: string(name='tollRoads'),
        tolls?: string(name='tolls', example='23'),
        trafficLights?: string(name='trafficLights'),
        transitFee?: string(name='transitFee'),
      }(name='cost'),
      distanceMeter?: string(name='distanceMeter', example='445'),
      restriction?: string(name='restriction'),
      steps?: [ 
        {
          cost?: {
            durationSecond?: string(name='durationSecond', example='27647'),
            taxiFee?: string(name='taxiFee'),
            tollDistanceMeter?: string(name='tollDistanceMeter'),
            tollRoads?: string(name='tollRoads', example='xxx'),
            tolls?: string(name='tolls'),
            trafficLights?: string(name='trafficLights', example='5'),
            transitFee?: string(name='transitFee'),
          }(name='cost'),
          instruction?: string(name='instruction'),
          orientation?: string(name='orientation'),
          roadName?: string(name='roadName'),
          stepDistanceMeter?: string(name='stepDistanceMeter', example='500'),
        }
      ](name='steps'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='ECB2144C-E277-5434-80E6-12D26678D364'),
}

model DrivingDirectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DrivingDirectionResponseBody(name='body'),
}

/**
 * @summary 根据起终点坐标检索符合条件的驾车路线规划方案
 *
 * @param request DrivingDirectionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DrivingDirectionResponse
 */
async function drivingDirectionWithOptions(request: DrivingDirectionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DrivingDirectionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.destinationLatitude)) {
    query['destinationLatitude'] = request.destinationLatitude;
  }
  if (!Util.isUnset(request.destinationLongitude)) {
    query['destinationLongitude'] = request.destinationLongitude;
  }
  if (!Util.isUnset(request.originLatitude)) {
    query['originLatitude'] = request.originLatitude;
  }
  if (!Util.isUnset(request.originLongitude)) {
    query['originLongitude'] = request.originLongitude;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DrivingDirection',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v1/direction/driving`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据起终点坐标检索符合条件的驾车路线规划方案
 *
 * @param request DrivingDirectionRequest
 * @return DrivingDirectionResponse
 */
async function drivingDirection(request: DrivingDirectionRequest): DrivingDirectionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return drivingDirectionWithOptions(request, headers, runtime);
}

model DrivingDirectionNovaRequest {
  carType?: string(name='carType'),
  destinationLatitude?: string(name='destinationLatitude', example='43.345456'),
  destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
  originLatitude?: string(name='originLatitude', example='39.995197'),
  originLongitude?: string(name='originLongitude', example='116.466485'),
  plate?: string(name='plate'),
  showPolyline?: boolean(name='showPolyline'),
}

model DrivingDirectionNovaResponseBody = {
  data?: {
    count?: string(name='count'),
    destinationLatitude?: string(name='destinationLatitude', example='40.345456'),
    destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
    originLatitude?: string(name='originLatitude', example='39.995197'),
    originLongitude?: string(name='originLongitude', example='117.466485'),
    paths?: [ 
      {
        cost?: {
          durationSecond?: string(name='durationSecond', example='39233'),
          taxiFee?: string(name='taxiFee', example='20'),
          tollDistanceMeter?: string(name='tollDistanceMeter'),
          tollRoads?: string(name='tollRoads'),
          tolls?: string(name='tolls'),
          trafficLights?: string(name='trafficLights', example='3'),
          transitFee?: string(name='transitFee', example='10'),
        }(name='cost'),
        distanceMeter?: string(name='distanceMeter', example='96375'),
        durationSecond?: string(name='durationSecond', example='39223'),
        restriction?: string(name='restriction'),
        steps?: [ 
          {
            cost?: {
              durationSecond?: string(name='durationSecond', example='1234'),
              taxiFee?: string(name='taxiFee', example='20'),
              tollDistanceMeter?: string(name='tollDistanceMeter'),
              tollRoads?: string(name='tollRoads'),
              tolls?: string(name='tolls'),
              trafficLights?: string(name='trafficLights'),
              transitFee?: string(name='transitFee'),
            }(name='cost'),
            instruction?: string(name='instruction'),
            orientation?: string(name='orientation'),
            polyline?: string(name='polyline'),
            roadName?: string(name='roadName'),
            stepDistanceMeter?: string(name='stepDistanceMeter', example='3000'),
          }
        ](name='steps'),
      }
    ](name='paths'),
    taxiCost?: string(name='taxiCost', example='20'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model DrivingDirectionNovaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DrivingDirectionNovaResponseBody(name='body'),
}

/**
 * @summary 根据起终点坐标检索符合条件的驾车路线规划方案
 *
 * @param request DrivingDirectionNovaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DrivingDirectionNovaResponse
 */
async function drivingDirectionNovaWithOptions(request: DrivingDirectionNovaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DrivingDirectionNovaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.carType)) {
    query['carType'] = request.carType;
  }
  if (!Util.isUnset(request.destinationLatitude)) {
    query['destinationLatitude'] = request.destinationLatitude;
  }
  if (!Util.isUnset(request.destinationLongitude)) {
    query['destinationLongitude'] = request.destinationLongitude;
  }
  if (!Util.isUnset(request.originLatitude)) {
    query['originLatitude'] = request.originLatitude;
  }
  if (!Util.isUnset(request.originLongitude)) {
    query['originLongitude'] = request.originLongitude;
  }
  if (!Util.isUnset(request.plate)) {
    query['plate'] = request.plate;
  }
  if (!Util.isUnset(request.showPolyline)) {
    query['showPolyline'] = request.showPolyline;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DrivingDirectionNova',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/direction/driving`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据起终点坐标检索符合条件的驾车路线规划方案
 *
 * @param request DrivingDirectionNovaRequest
 * @return DrivingDirectionNovaResponse
 */
async function drivingDirectionNova(request: DrivingDirectionNovaRequest): DrivingDirectionNovaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return drivingDirectionNovaWithOptions(request, headers, runtime);
}

model ElectrobikeDirectionNovaRequest {
  destinationLatitude?: string(name='destinationLatitude', example='40.234564'),
  destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
  originLatitude?: string(name='originLatitude', example='39.995197'),
  originLongitude?: string(name='originLongitude', example='116.345456'),
  showPolyline?: boolean(name='showPolyline'),
}

model ElectrobikeDirectionNovaResponseBody = {
  data?: {
    count?: string(name='count'),
    destinationLatitude?: string(name='destinationLatitude', example='40.345456'),
    destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
    originLatitude?: string(name='originLatitude', example='39.995197'),
    originLongitude?: string(name='originLongitude', example='116.345456'),
    paths?: [ 
      {
        cost?: {
          durationSecond?: string(name='durationSecond', example='500'),
          taxiFee?: string(name='taxiFee', example='20'),
          tollDistanceMeter?: string(name='tollDistanceMeter'),
          tollRoads?: string(name='tollRoads'),
          tolls?: string(name='tolls'),
          trafficLights?: string(name='trafficLights', example='4'),
          transitFee?: string(name='transitFee', example='4'),
        }(name='cost'),
        distanceMeter?: string(name='distanceMeter', example='12000'),
        durationSecond?: string(name='durationSecond', example='300'),
        restriction?: string(name='restriction'),
        steps?: [ 
          {
            cost?: {
              durationSecond?: string(name='durationSecond', example='2000'),
              taxiFee?: string(name='taxiFee', example='20'),
              tollDistanceMeter?: string(name='tollDistanceMeter'),
              tollRoads?: string(name='tollRoads'),
              tolls?: string(name='tolls'),
              trafficLights?: string(name='trafficLights', example='5'),
              transitFee?: string(name='transitFee'),
            }(name='cost'),
            instruction?: string(name='instruction'),
            orientation?: string(name='orientation'),
            polyline?: string(name='polyline'),
            roadName?: string(name='roadName'),
            stepDistanceMeter?: string(name='stepDistanceMeter', example='3000'),
          }
        ](name='steps'),
      }
    ](name='paths'),
    taxiCost?: string(name='taxiCost', example='20'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model ElectrobikeDirectionNovaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ElectrobikeDirectionNovaResponseBody(name='body'),
}

/**
 * @summary 电动车路线规划方案V2
 *
 * @param request ElectrobikeDirectionNovaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ElectrobikeDirectionNovaResponse
 */
async function electrobikeDirectionNovaWithOptions(request: ElectrobikeDirectionNovaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ElectrobikeDirectionNovaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.destinationLatitude)) {
    query['destinationLatitude'] = request.destinationLatitude;
  }
  if (!Util.isUnset(request.destinationLongitude)) {
    query['destinationLongitude'] = request.destinationLongitude;
  }
  if (!Util.isUnset(request.originLatitude)) {
    query['originLatitude'] = request.originLatitude;
  }
  if (!Util.isUnset(request.originLongitude)) {
    query['originLongitude'] = request.originLongitude;
  }
  if (!Util.isUnset(request.showPolyline)) {
    query['showPolyline'] = request.showPolyline;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ElectrobikeDirectionNova',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/direction/electrobike`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 电动车路线规划方案V2
 *
 * @param request ElectrobikeDirectionNovaRequest
 * @return ElectrobikeDirectionNovaResponse
 */
async function electrobikeDirectionNova(request: ElectrobikeDirectionNovaRequest): ElectrobikeDirectionNovaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return electrobikeDirectionNovaWithOptions(request, headers, runtime);
}

model GeoCodeRequest {
  address?: string(name='address'),
  city?: string(name='city'),
}

model GeoCodeResponseBody = {
  data?: [ 
    {
      building?: {
        name?: string(name='name', example='timeliness_ms'),
        type?: string(name='type', example='internal'),
      }(name='building'),
      city?: string(name='city'),
      cityCode?: string(name='cityCode'),
      district?: string(name='district'),
      districtCode?: string(name='districtCode'),
      latitude?: string(name='latitude'),
      level?: string(name='level'),
      longitude?: string(name='longitude'),
      number?: string(name='number', example='12201281024024'),
      province?: string(name='province'),
      street?: string(name='street'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
}

model GeoCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GeoCodeResponseBody(name='body'),
}

/**
 * @summary 地理编码，将详细的结构化地址转换为高德经纬度坐标
 *
 * @param request GeoCodeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GeoCodeResponse
 */
async function geoCodeWithOptions(request: GeoCodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GeoCodeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.address)) {
    query['address'] = request.address;
  }
  if (!Util.isUnset(request.city)) {
    query['city'] = request.city;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GeoCode',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v1/geocode/geo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 地理编码，将详细的结构化地址转换为高德经纬度坐标
 *
 * @param request GeoCodeRequest
 * @return GeoCodeResponse
 */
async function geoCode(request: GeoCodeRequest): GeoCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return geoCodeWithOptions(request, headers, runtime);
}

model NearbySearchNovaRequest {
  cityLimit?: boolean(name='cityLimit'),
  keywords?: string(name='keywords'),
  latitude?: string(name='latitude', example='39.992873'),
  longitude?: string(name='longitude', example='116.310918'),
  page?: int32(name='page', example='1'),
  radius?: int32(name='radius', example='3000'),
  size?: int32(name='size', example='5'),
  sortRule?: string(name='sortRule'),
  types?: string(name='types', example='GAS_STATION|RESTAURANT|HOTEL|ATTRACTION'),
}

model NearbySearchNovaResponseBody = {
  data?: [ 
    {
      address?: string(name='address'),
      cityCode?: string(name='cityCode', example='010'),
      cityName?: string(name='cityName'),
      distanceMeter?: string(name='distanceMeter', example='445'),
      districtCode?: string(name='districtCode'),
      districtName?: string(name='districtName'),
      id?: string(name='id', example='34360'),
      images?: [ 
        {
          title?: string(name='title', example='test'),
          url?: string(name='url', example='https://alidocs.dingtalk.com/i/team/nb9XJVAdyvMrOXyA/docs/b9XJlRRKq1BQaGyA'),
        }
      ](name='images'),
      latitude?: string(name='latitude', example='39.994135'),
      longitude?: string(name='longitude', example='108.970162'),
      metadata?: {
        averageSpend?: string(name='averageSpend', example='22.00'),
        businessArea?: string(name='businessArea'),
        dailyOpeningHours?: string(name='dailyOpeningHours', example='11:00-14:00 17:00-21:00'),
        mainTag?: string(name='mainTag'),
        phone?: string(name='phone', example='029-87983745'),
        score?: string(name='score', example='4.5'),
        tag?: string(name='tag'),
        weeklyOpeningDays?: string(name='weeklyOpeningDays'),
      }(name='metadata'),
      name?: string(name='name'),
      provinceCode?: string(name='provinceCode', example='110000'),
      provinceName?: string(name='provinceName'),
      typeCode?: string(name='typeCode', example='110200'),
      types?: string(name='types'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
}

model NearbySearchNovaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: NearbySearchNovaResponseBody(name='body'),
}

/**
 * @summary 通过经纬度查询附近的地点
 *
 * @param request NearbySearchNovaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return NearbySearchNovaResponse
 */
async function nearbySearchNovaWithOptions(request: NearbySearchNovaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): NearbySearchNovaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.cityLimit)) {
    query['cityLimit'] = request.cityLimit;
  }
  if (!Util.isUnset(request.keywords)) {
    query['keywords'] = request.keywords;
  }
  if (!Util.isUnset(request.latitude)) {
    query['latitude'] = request.latitude;
  }
  if (!Util.isUnset(request.longitude)) {
    query['longitude'] = request.longitude;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.radius)) {
    query['radius'] = request.radius;
  }
  if (!Util.isUnset(request.size)) {
    query['size'] = request.size;
  }
  if (!Util.isUnset(request.sortRule)) {
    query['sortRule'] = request.sortRule;
  }
  if (!Util.isUnset(request.types)) {
    query['types'] = request.types;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'NearbySearchNova',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/pois/nearby`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过经纬度查询附近的地点
 *
 * @param request NearbySearchNovaRequest
 * @return NearbySearchNovaResponse
 */
async function nearbySearchNova(request: NearbySearchNovaRequest): NearbySearchNovaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return nearbySearchNovaWithOptions(request, headers, runtime);
}

model PlaceSearchNovaRequest {
  cityLimit?: boolean(name='cityLimit'),
  keywords?: string(name='keywords'),
  page?: int32(name='page', example='1'),
  region?: string(name='region'),
  size?: int32(name='size', example='5'),
  types?: string(name='types', example='GAS_STATION|RESTAURANT|HOTEL|ATTRACTION'),
}

model PlaceSearchNovaResponseBody = {
  data?: [ 
    {
      address?: string(name='address'),
      cityCode?: string(name='cityCode', example='010'),
      cityName?: string(name='cityName'),
      distanceMeter?: string(name='distanceMeter', example='445'),
      districtCode?: string(name='districtCode', example='110105'),
      districtName?: string(name='districtName'),
      id?: string(name='id', example='34360'),
      images?: [ 
        {
          title?: string(name='title', example='test'),
          url?: string(name='url', example='https://aos-comment.amap.com/B000A8UNZV/comment/f0a5ca9b58a31f63f8af51f459f75e4b_2048_2048_80.jpg'),
        }
      ](name='images'),
      latitude?: string(name='latitude', example='39.990039'),
      longitude?: string(name='longitude', example='116.482145'),
      metadata?: {
        averageSpend?: string(name='averageSpend', example='78'),
        businessArea?: string(name='businessArea'),
        dailyOpeningHours?: string(name='dailyOpeningHours'),
        mainTag?: string(name='mainTag'),
        phone?: string(name='phone', example='010-83847583'),
        score?: string(name='score'),
        tag?: string(name='tag', example='[{\\\\"value\\\\":\\\\"nttd\\\\",\\\\"key\\\\":\\\\"owner\\\\"}]'),
        weeklyOpeningDays?: string(name='weeklyOpeningDays'),
      }(name='metadata'),
      name?: string(name='name', example='hydro-project/hydro-res-auth'),
      provinceCode?: string(name='provinceCode', example='110000'),
      provinceName?: string(name='provinceName'),
      typeCode?: string(name='typeCode', example='110200'),
      types?: string(name='types'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
}

model PlaceSearchNovaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PlaceSearchNovaResponseBody(name='body'),
}

/**
 * @summary 通过关键词搜索地点
 *
 * @param request PlaceSearchNovaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PlaceSearchNovaResponse
 */
async function placeSearchNovaWithOptions(request: PlaceSearchNovaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PlaceSearchNovaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.cityLimit)) {
    query['cityLimit'] = request.cityLimit;
  }
  if (!Util.isUnset(request.keywords)) {
    query['keywords'] = request.keywords;
  }
  if (!Util.isUnset(request.page)) {
    query['page'] = request.page;
  }
  if (!Util.isUnset(request.region)) {
    query['region'] = request.region;
  }
  if (!Util.isUnset(request.size)) {
    query['size'] = request.size;
  }
  if (!Util.isUnset(request.types)) {
    query['types'] = request.types;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PlaceSearchNova',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/pois/place`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 通过关键词搜索地点
 *
 * @param request PlaceSearchNovaRequest
 * @return PlaceSearchNovaResponse
 */
async function placeSearchNova(request: PlaceSearchNovaRequest): PlaceSearchNovaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return placeSearchNovaWithOptions(request, headers, runtime);
}

model QueryAttractionsRequest {
  body?: AgentBaseQuery(name='body'),
}

model QueryAttractionsResponseBody = {
  queryResult?: QueryResult(name='queryResult'),
  requestId?: string(name='requestId', description='Id of the request', example='ECB2144C-E277-5434-80E6-12D26678D364'),
}

model QueryAttractionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAttractionsResponseBody(name='body'),
}

/**
 * @summary 景点查询
 *
 * @param request QueryAttractionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAttractionsResponse
 */
async function queryAttractionsWithOptions(request: QueryAttractionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryAttractionsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryAttractions',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v1/nl/attractions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 景点查询
 *
 * @param request QueryAttractionsRequest
 * @return QueryAttractionsResponse
 */
async function queryAttractions(request: QueryAttractionsRequest): QueryAttractionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryAttractionsWithOptions(request, headers, runtime);
}

model QueryAttractionsNlRequest {
  body?: AgentBaseQuery(name='body'),
}

model QueryAttractionsNlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryResult  
}

/**
 * @summary 景点查询
 *
 * @param request QueryAttractionsNlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAttractionsNlResponse
 */
async function queryAttractionsNlWithOptions(request: QueryAttractionsNlRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryAttractionsNlResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryAttractionsNl',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v2/nl/attractions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 景点查询
 *
 * @param request QueryAttractionsNlRequest
 * @return QueryAttractionsNlResponse
 */
async function queryAttractionsNl(request: QueryAttractionsNlRequest): QueryAttractionsNlResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryAttractionsNlWithOptions(request, headers, runtime);
}

model QueryHotelsRequest {
  body?: AgentBaseQuery(name='body'),
}

model QueryHotelsResponseBody = {
  queryResult?: QueryResult(name='queryResult'),
  requestId?: string(name='requestId', description='Id of the request', example='78032F8B-0157-53F9-B1A8-3BD86ADE38D0'),
}

model QueryHotelsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryHotelsResponseBody(name='body'),
}

/**
 * @summary 酒店查询
 *
 * @param request QueryHotelsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryHotelsResponse
 */
async function queryHotelsWithOptions(request: QueryHotelsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryHotelsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryHotels',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v1/nl/hotels`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 酒店查询
 *
 * @param request QueryHotelsRequest
 * @return QueryHotelsResponse
 */
async function queryHotels(request: QueryHotelsRequest): QueryHotelsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryHotelsWithOptions(request, headers, runtime);
}

model QueryHotelsNlRequest {
  body?: AgentBaseQuery(name='body'),
}

model QueryHotelsNlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryResult  
}

/**
 * @summary 酒店查询
 *
 * @param request QueryHotelsNlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryHotelsNlResponse
 */
async function queryHotelsNlWithOptions(request: QueryHotelsNlRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryHotelsNlResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryHotelsNl',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v2/nl/hotels`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 酒店查询
 *
 * @param request QueryHotelsNlRequest
 * @return QueryHotelsNlResponse
 */
async function queryHotelsNl(request: QueryHotelsNlRequest): QueryHotelsNlResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryHotelsNlWithOptions(request, headers, runtime);
}

model QueryRestaurantsRequest {
  body?: AgentBaseQuery(name='body'),
}

model QueryRestaurantsResponseBody = {
  queryResult?: QueryResult(name='queryResult'),
  requestId?: string(name='requestId', description='Id of the request', example='D78E16C0-4D44-5065-BFF7-127F7859F687'),
}

model QueryRestaurantsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRestaurantsResponseBody(name='body'),
}

/**
 * @summary 餐厅查询
 *
 * @param request QueryRestaurantsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRestaurantsResponse
 */
async function queryRestaurantsWithOptions(request: QueryRestaurantsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryRestaurantsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRestaurants',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v1/nl/restaurants`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 餐厅查询
 *
 * @param request QueryRestaurantsRequest
 * @return QueryRestaurantsResponse
 */
async function queryRestaurants(request: QueryRestaurantsRequest): QueryRestaurantsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryRestaurantsWithOptions(request, headers, runtime);
}

model QueryRestaurantsNlRequest {
  body?: AgentBaseQuery(name='body'),
}

model QueryRestaurantsNlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryResult  
}

/**
 * @summary 餐厅查询
 *
 * @param request QueryRestaurantsNlRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryRestaurantsNlResponse
 */
async function queryRestaurantsNlWithOptions(request: QueryRestaurantsNlRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryRestaurantsNlResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(request.body),
  };
  var params = new OpenApi.Params{
    action = 'QueryRestaurantsNl',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/amap-function-call-agent/iqs-agent-service/v2/nl/restaurants`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 餐厅查询
 *
 * @param request QueryRestaurantsNlRequest
 * @return QueryRestaurantsNlResponse
 */
async function queryRestaurantsNl(request: QueryRestaurantsNlRequest): QueryRestaurantsNlResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryRestaurantsNlWithOptions(request, headers, runtime);
}

model RgeoCodeRequest {
  latitude?: string(name='latitude', example='39.989027'),
  longitude?: string(name='longitude', example='116.310918'),
}

model RgeoCodeResponseBody = {
  data?: {
    building?: {
      name?: string(name='name'),
      type?: string(name='type'),
    }(name='building'),
    businessAreas?: [ 
      {
        id?: string(name='id', example='110108'),
        latitude?: string(name='latitude', example='39.996850'),
        longitude?: string(name='longitude', example='116.294214'),
        name?: string(name='name'),
      }
    ](name='businessAreas'),
    city?: string(name='city'),
    cityCode?: string(name='cityCode', example='010'),
    country?: string(name='country'),
    district?: string(name='district'),
    districtCode?: string(name='districtCode', example='110108'),
    formattedAddress?: string(name='formattedAddress'),
    neighborhood?: {
      name?: string(name='name'),
      type?: string(name='type'),
    }(name='neighborhood'),
    province?: string(name='province'),
    streetNumber?: {
      direction?: string(name='direction'),
      distanceMeter?: string(name='distanceMeter', example='289.832'),
      latitude?: string(name='latitude', example='39.986542'),
      longitude?: string(name='longitude', example='116.311943'),
      number?: string(name='number'),
      street?: string(name='street'),
    }(name='streetNumber'),
    townCode?: string(name='townCode', example='110108015000'),
    townShip?: string(name='townShip'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model RgeoCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RgeoCodeResponseBody(name='body'),
}

/**
 * @summary 逆地理编码，将经纬度转换为详细结构化的地址信息
 *
 * @param request RgeoCodeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RgeoCodeResponse
 */
async function rgeoCodeWithOptions(request: RgeoCodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RgeoCodeResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.latitude)) {
    query['latitude'] = request.latitude;
  }
  if (!Util.isUnset(request.longitude)) {
    query['longitude'] = request.longitude;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RgeoCode',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v1/geocode/regeo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 逆地理编码，将经纬度转换为详细结构化的地址信息
 *
 * @param request RgeoCodeRequest
 * @return RgeoCodeResponse
 */
async function rgeoCode(request: RgeoCodeRequest): RgeoCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return rgeoCodeWithOptions(request, headers, runtime);
}

model TransitIntegratedDirectionRequest {
  destinationCity?: string(name='destinationCity'),
  destinationLatitude?: string(name='destinationLatitude', example='40.345456'),
  destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
  originCity?: string(name='originCity'),
  originLatitude?: string(name='originLatitude', example='39.995197'),
  originLongitude?: string(name='originLongitude', example='116.466485'),
  showPolyline?: boolean(name='showPolyline'),
}

model TransitIntegratedDirectionResponseBody = {
  data?: {
    cost?: {
      durationSecond?: string(name='durationSecond', example='1231'),
      taxiFee?: string(name='taxiFee', example='6'),
      tollDistanceMeter?: string(name='tollDistanceMeter'),
      tollRoads?: string(name='tollRoads'),
      tolls?: string(name='tolls', example='23'),
      trafficLights?: string(name='trafficLights'),
      transitFee?: string(name='transitFee'),
    }(name='cost'),
    count?: string(name='count', example='5'),
    destinationLatitude?: string(name='destinationLatitude', example='39.995197'),
    destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
    distanceMeter?: string(name='distanceMeter', example='445'),
    originLatitude?: string(name='originLatitude', example='39.995197'),
    originLongitude?: string(name='originLongitude', example='116.466485'),
    paths?: [ 
      {
        cost?: {
          durationSecond?: string(name='durationSecond', example='39233'),
          taxiFee?: string(name='taxiFee', example='20'),
          tollDistanceMeter?: string(name='tollDistanceMeter', example='2000'),
          tollRoads?: string(name='tollRoads'),
          tolls?: string(name='tolls'),
          trafficLights?: string(name='trafficLights'),
          transitFee?: string(name='transitFee', example='4'),
        }(name='cost'),
        distanceMeter?: string(name='distanceMeter', example='12000'),
        nightflag?: string(name='nightflag'),
        segments?: [ 
          {
            bus?: {
              buslines?: [ 
                {
                  arrivalStop?: {
                    exit?: {
                      id?: string(name='id', example='900000028907015'),
                      location?: string(name='location', example='116.468213,39.998876'),
                      name?: string(name='name'),
                    }(name='exit'),
                    id?: string(name='id', example='100935'),
                    location?: string(name='location', example='119.82416178385417,30.27139702690972'),
                    name?: string(name='name'),
                  }(name='arrivalStop'),
                  busTimeTips?: string(name='busTimeTips'),
                  bustimetag?: string(name='bustimetag', example='0'),
                  cost?: {
                    durationSecond?: string(name='durationSecond', example='1521'),
                    taxiFee?: string(name='taxiFee'),
                    tollDistanceMeter?: string(name='tollDistanceMeter'),
                    tollRoads?: string(name='tollRoads'),
                    tolls?: string(name='tolls'),
                    trafficLights?: string(name='trafficLights'),
                    transitFee?: string(name='transitFee'),
                  }(name='cost'),
                  departureStop?: {
                    entrance?: {
                      id?: string(name='id', example='99088345834'),
                      location?: string(name='location', example='116.468213,39.998876'),
                      name?: string(name='name'),
                    }(name='entrance'),
                    id?: string(name='id', example='60852'),
                    location?: string(name='location', example='116.468213,39.998876'),
                    name?: string(name='name'),
                  }(name='departureStop'),
                  distanceMeter?: string(name='distanceMeter', example='13322'),
                  endTime?: string(name='endTime', example='2259'),
                  id?: string(name='id', example='900000028907'),
                  name?: string(name='name'),
                  polyline?: {
                    polyline?: string(name='polyline', example='116.471544,39.991835'),
                  }(name='polyline'),
                  startTime?: string(name='startTime', example='0509'),
                  type?: string(name='type'),
                  viaNum?: string(name='viaNum', example='8'),
                  viaStops?: [ 
                    {
                      id?: string(name='id'),
                      location?: string(name='location'),
                      name?: string(name='name'),
                    }
                  ](name='viaStops'),
                }
              ](name='buslines'),
              index?: string(name='index'),
            }(name='bus'),
            railway?: {
              arrivalStop?: {
                adcode?: string(name='adcode', example='023'),
                end?: string(name='end', description='end', example='1699410466578'),
                id?: string(name='id', example='8234837534'),
                location?: string(name='location', example='101.45625135633681,25.08939480251736'),
                name?: string(name='name'),
                time?: string(name='time', example='2024-10-28 10:10:32'),
              }(name='arrivalStop'),
              departureStop?: {
                adcode?: string(name='adcode', example='029'),
                id?: string(name='id', example='100937'),
                location?: string(name='location', example='101.45625135633681,25.08939480251736'),
                name?: string(name='name'),
                start?: string(name='start', example='1729440000000'),
                time?: string(name='time', example='2024-09-30 10:04:13'),
              }(name='departureStop'),
              distanceMeter?: string(name='distanceMeter', example='398734'),
              id?: string(name='id', example='434508'),
              index?: string(name='index'),
              name?: string(name='name'),
              spaces?: [ 
                {
                  code?: string(name='code'),
                  cost?: string(name='cost', example='150'),
                }
              ](name='spaces'),
              time?: string(name='time', example='2024-09-28 10:07:22'),
              trip?: string(name='trip'),
              type?: string(name='type'),
            }(name='railway'),
            taxi?: {
              destinationName?: string(name='destinationName', example='xxx'),
              destinationPoint?: string(name='destinationPoint', example='116.464297,39.896458'),
              distanceMeter?: string(name='distanceMeter', example='1772'),
              driveTimeSecond?: string(name='driveTimeSecond', example='720'),
              index?: string(name='index'),
              originName?: string(name='originName'),
              originPoint?: string(name='originPoint', example='116.476597,39.893420'),
              polyline?: {
                polyline?: string(name='polyline'),
              }(name='polyline'),
              price?: string(name='price', example='13.5'),
            }(name='taxi'),
            walking?: {
              cost?: {
                durationSecond?: string(name='durationSecond', example='468'),
                taxiFee?: string(name='taxiFee'),
                tollDistanceMeter?: string(name='tollDistanceMeter'),
                tollRoads?: string(name='tollRoads'),
                tolls?: string(name='tolls'),
                trafficLights?: string(name='trafficLights'),
                transitFee?: string(name='transitFee', example='3'),
              }(name='cost'),
              destination?: string(name='destination', example='116.468208,39.998875'),
              distanceMeter?: string(name='distanceMeter', example='546'),
              index?: string(name='index'),
              origin?: string(name='origin', example='116.466568,39.995552'),
              steps?: [ 
                {
                  cost?: {
                    durationSecond?: string(name='durationSecond', example='435'),
                    taxiFee?: string(name='taxiFee'),
                    tollDistanceMeter?: string(name='tollDistanceMeter'),
                    tollRoads?: string(name='tollRoads'),
                    tolls?: string(name='tolls'),
                    trafficLights?: string(name='trafficLights'),
                    transitFee?: string(name='transitFee'),
                  }(name='cost'),
                  instruction?: string(name='instruction'),
                  orientation?: string(name='orientation'),
                  polyline?: {
                    polyline?: string(name='polyline', example='116.467751,39.997631;116.467430,39.997631'),
                  }(name='polyline'),
                  roadName?: string(name='roadName'),
                  stepDistanceMeter?: string(name='stepDistanceMeter'),
                }
              ](name='steps'),
            }(name='walking'),
          }
        ](name='segments'),
        walkingDistanceMeter?: string(name='walkingDistanceMeter', example='23435'),
      }
    ](name='paths'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model TransitIntegratedDirectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransitIntegratedDirectionResponseBody(name='body'),
}

/**
 * @summary 公共交通路线规划方案
 *
 * @param request TransitIntegratedDirectionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransitIntegratedDirectionResponse
 */
async function transitIntegratedDirectionWithOptions(request: TransitIntegratedDirectionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): TransitIntegratedDirectionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.destinationCity)) {
    query['destinationCity'] = request.destinationCity;
  }
  if (!Util.isUnset(request.destinationLatitude)) {
    query['destinationLatitude'] = request.destinationLatitude;
  }
  if (!Util.isUnset(request.destinationLongitude)) {
    query['destinationLongitude'] = request.destinationLongitude;
  }
  if (!Util.isUnset(request.originCity)) {
    query['originCity'] = request.originCity;
  }
  if (!Util.isUnset(request.originLatitude)) {
    query['originLatitude'] = request.originLatitude;
  }
  if (!Util.isUnset(request.originLongitude)) {
    query['originLongitude'] = request.originLongitude;
  }
  if (!Util.isUnset(request.showPolyline)) {
    query['showPolyline'] = request.showPolyline;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransitIntegratedDirection',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/direction/transit/integrated`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 公共交通路线规划方案
 *
 * @param request TransitIntegratedDirectionRequest
 * @return TransitIntegratedDirectionResponse
 */
async function transitIntegratedDirection(request: TransitIntegratedDirectionRequest): TransitIntegratedDirectionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return transitIntegratedDirectionWithOptions(request, headers, runtime);
}

model WalkingDirectionNovaRequest {
  destinationLatitude?: string(name='destinationLatitude', example='40.345456'),
  destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
  originLatitude?: string(name='originLatitude', example='39.995197'),
  originLongitude?: string(name='originLongitude', example='116.466485'),
  showPolyline?: boolean(name='showPolyline'),
}

model WalkingDirectionNovaResponseBody = {
  data?: {
    count?: string(name='count'),
    destinationLatitude?: string(name='destinationLatitude', example='40.020642'),
    destinationLongitude?: string(name='destinationLongitude', example='116.46424'),
    originLatitude?: string(name='originLatitude', example='39.995197'),
    originLongitude?: string(name='originLongitude', example='116.466485'),
    paths?: [ 
      {
        cost?: {
          durationSecond?: string(name='durationSecond', example='1232'),
          taxiFee?: string(name='taxiFee', example='20'),
          tollDistanceMeter?: string(name='tollDistanceMeter'),
          tollRoads?: string(name='tollRoads'),
          tolls?: string(name='tolls'),
          trafficLights?: string(name='trafficLights', example='3'),
          transitFee?: string(name='transitFee', example='10'),
        }(name='cost'),
        distanceMeter?: string(name='distanceMeter', example='12000'),
        durationSecond?: string(name='durationSecond', example='39223'),
        restriction?: string(name='restriction'),
        steps?: [ 
          {
            cost?: {
              durationSecond?: string(name='durationSecond', example='13'),
              taxiFee?: string(name='taxiFee', example='20'),
              tollDistanceMeter?: string(name='tollDistanceMeter'),
              tollRoads?: string(name='tollRoads'),
              tolls?: string(name='tolls'),
              trafficLights?: string(name='trafficLights'),
              transitFee?: string(name='transitFee'),
            }(name='cost'),
            instruction?: string(name='instruction'),
            orientation?: string(name='orientation'),
            polyline?: string(name='polyline'),
            roadName?: string(name='roadName'),
            stepDistanceMeter?: string(name='stepDistanceMeter', example='1665'),
          }
        ](name='steps'),
      }
    ](name='paths'),
    taxiCost?: string(name='taxiCost', example='8'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model WalkingDirectionNovaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WalkingDirectionNovaResponseBody(name='body'),
}

/**
 * @summary 根据起终点坐标检索符合条件的步行路线规划方案
 *
 * @param request WalkingDirectionNovaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return WalkingDirectionNovaResponse
 */
async function walkingDirectionNovaWithOptions(request: WalkingDirectionNovaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): WalkingDirectionNovaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.destinationLatitude)) {
    query['destinationLatitude'] = request.destinationLatitude;
  }
  if (!Util.isUnset(request.destinationLongitude)) {
    query['destinationLongitude'] = request.destinationLongitude;
  }
  if (!Util.isUnset(request.originLatitude)) {
    query['originLatitude'] = request.originLatitude;
  }
  if (!Util.isUnset(request.originLongitude)) {
    query['originLongitude'] = request.originLongitude;
  }
  if (!Util.isUnset(request.showPolyline)) {
    query['showPolyline'] = request.showPolyline;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'WalkingDirectionNova',
    version = '2024-07-12',
    protocol = 'HTTPS',
    pathname = `/ipaas/v2/direction/walking`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 根据起终点坐标检索符合条件的步行路线规划方案
 *
 * @param request WalkingDirectionNovaRequest
 * @return WalkingDirectionNovaResponse
 */
async function walkingDirectionNova(request: WalkingDirectionNovaRequest): WalkingDirectionNovaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return walkingDirectionNovaWithOptions(request, headers, runtime);
}

